SQL error: SELECT * FROM static WHERE url_friendly='/js/fancybox/' selectedOpts.href '' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selectedOpts.href ''' at line 1